﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Collections;
using System.Data.SqlClient;
using ZLDC.Common.BaseUser;

namespace ZLDC.Common
{
    public class C_ArrayList
    {
        public C_ArrayList()
        {
        }

        public static ArrayList add_List(string colname, string sql)
        {
            SqlDataReader dr;
            DataBase db = new DataBase();
            dr = db.SelectRecord(sql);
            ArrayList MyList = new ArrayList();
            MyList.Add("");
            while (dr.Read())
            {
                MyList.Add(dr["" + colname + ""].ToString());
            }
            dr.Close();
            db.ConnectClose();
            return MyList;
        }

        public static ArrayList add_ListAll(string colname, string sql)
        {
            SqlDataReader dr;
            DataBase db = new DataBase();
            dr = db.SelectRecord(sql);
            ArrayList MyList = new ArrayList();
            MyList.Add("All");
            while (dr.Read())
            {
                MyList.Add(dr["" + colname + ""].ToString());
            }
            dr.Close();
            db.ConnectClose();
            return MyList;
        }
    }
}
